#pragma GCC optimize(2, "Ofast", "inline")
#include <iostream>
#include <vector>
#include <map>
#include <cmath>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <algorithm>
#define endl '\n'
#define int long long
#define pii pair<int, int>
using namespace std;

// 已知
int n, x;
// 未知
set<int> s;
signed main()
{
    cin.tie(0)->sync_with_stdio(0);
    cin >> n;
    for (int i = 0;i < n;++i)
    {
        cin >> x;
        s.insert(x);
    }
    cout << s.size() << endl;
    for (auto i : s)
    {
        cout << i << " ";
    }
    cout << endl;
    return 0;
}